#include<iostream>
#include<cstdio>
using namespace std;
int n,f[200001],vis[200001];
int main(){
	freopen("fruit.in","r",stdin); 
	freopen("fruit.out","w",stdout);
	cin>>n;
	for(int i=1;i<=n;i++) scanf("%d",&f[i]);
	while(1){
		int t=-1;
		for(int i=1;i<=n;i++){
			if(!vis[i]&&f[i]!=t){
				printf("%d ",i);
				t=f[i];
				vis[i]=1;
			}
		}
		printf("\n");
		bool flag=true;
		for(int i=1;i<=n;i++){
			if(!vis[i]) flag=false;
		}
		if(flag) break;
	}
	fclose(stdin);
	fclose(stdout);
	return 0;
}
